package com.brush.web.controller.sysoperlog;

import com.brush.common.core.controller.BaseController;
import com.brush.common.core.domain.R;
import com.brush.system.domain.req.sysoperlog.SysOperLogReq;
import com.brush.system.domain.resp.sysoperlog.SysOperLogResp;
import com.brush.system.service.SysOperLogService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: SysOperLogController
 * Package: com.exam.web.controller.sysoperlog
 * Description:
 *
 * @Author luo
 * @Create 2024/8/23 19:57
 * @Version 1.0
 */
@Api(tags = "后台-操作日志api")
@RestController
@RequestMapping(value = "/admin/operlog")
public class SysOperLogController extends BaseController {

    @Autowired
    protected SysOperLogService sysOperLogService;


    @PreAuthorize("@ss.hasPermi('system:operlog:list')")
    @ApiOperation(value = "分页查询")
    @GetMapping(value = "/list")
    public R<PageInfo<SysOperLogResp>> list(SysOperLogReq req) {
        PageInfo<SysOperLogResp> page = this.sysOperLogService.paginationQuery(req);
        return R.ok(page);
    }

    @PreAuthorize("@ss.hasPermi('system:operlog:query')")
    @ApiOperation(value = "根据id查询")
    @GetMapping("/{id}")
    public R<SysOperLogResp> findById(Long id) {
        SysOperLogResp sysOperLogResp = this.sysOperLogService.findById(id);
        return R.ok(sysOperLogResp);
    }


}
